use "/Users/donno/Applications/Dropbox/Daniela/Results/PTAformation_countryyear_withRatios_gsp.dta"
xtset ccode year

*Figure 1
twoway lowess exportsgdp year if year>=1978, xlabel(1979 2015) lcolor(gs2) lpattern(solid) name(G1, replace) title("Sample = High Surplus Labor Countries") ytitle("Exports to Rich Countries (%GDP)")
twoway (lowess nsPTA year if surpnew_highsl==1&developing==1, lcolor(gs4) lpattern(solid)) (lowess nsPTA year if surpnew_highsl==0&developing==1, lcolor(gs2) lpattern(dash) name(G2, replace)) if year>=1978,  ytitle("Avg. # PTA Memberships Per Country") legend(order(1 "NSPTA High Surplus Labor" 2 "NSPTA Average"))
graph combine G1 G2, cols(1) xcommon

*Models used to report Table 1 (Note Table 1 only reports summary of key coefficients)
xtreg  ssPTA l.ssPTA  l.surplab_new l.dexportinworld_brics l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&brics~=1, fe cluster(ccode)
xtreg  ssPTA l.ssPTA  l.surplab_new l.dexportinworld_brics l.WTO l.high_income_gsp l.surpxdexpinworld_brics l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&brics~=1, fe cluster(ccode)
xtreg  ssPTA l.ssPTA  l.surplab_new l.exportinworld_brics l.surpxexpinworld_brics l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&brics~=1, fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.dexportinworld_brics l.WTO  l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&brics~=1, fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.dexportinworld_brics l.WTO  l.high_income_gsp l.surpxdexpinworld_brics l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&brics~=1, fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.exportinworld_brics l.surpxexpinworld_brics l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&brics~=1, fe cluster(ccode)

xtreg  ssPTA l.ssPTA  l.surplab_new l.dexportinworld_BR l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="BRAZIL", fe cluster(ccode)
xtreg  ssPTA l.ssPTA  l.surplab_new l.dexportinworld_BR l.surpxdexpinworld_BR l.WTO  l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="BRAZIL", fe cluster(ccode)
xtreg  ssPTA l.ssPTA  l.surplab_new l.exportinworld_BR l.surpxexpinworld_BR l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="BRAZIL", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.dexportinworld_BR l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="BRAZIL", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.dexportinworld_BR  l.surpxdexpinworld_BR l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="BRAZIL", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.exportinworld_BR l.surpxexpinworld_BR l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="BRAZIL", fe cluster(ccode)

xtreg  ssPTA l.ssPTA  l.surplab_new l.dexportinworld_RU l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="RUSSIAN FEDERATION", fe cluster(ccode)
xtreg  ssPTA l.ssPTA  l.surplab_new l.dexportinworld_RU l.surpxdexpinworld_RU l.WTO l.high_income_gsp  l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="RUSSIAN FEDERATION", fe cluster(ccode)
xtreg  ssPTA l.ssPTA  l.surplab_new l.exportinworld_RU l.surpxexpinworld_RU l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="RUSSIAN FEDERATION", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.dexportinworld_RU l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="RUSSIAN FEDERATION", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.dexportinworld_RU  l.surpxdexpinworld_RU l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="RUSSIAN FEDERATION", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.exportinworld_RU l.surpxexpinworld_RU l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="RUSSIAN FEDERATION", fe cluster(ccode)

xtreg  ssPTA l.ssPTA  l.surplab_new l.dexportinworld_IN l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="INDIA", fe cluster(ccode)
xtreg  ssPTA l.ssPTA  l.surplab_new l.dexportinworld_IN l.surpxdexpinworld_IN l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="INDIA", fe cluster(ccode)
xtreg  ssPTA l.ssPTA  l.surplab_new l.exportinworld_IN l.surpxexpinworld_IN l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="INDIA", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.dexportinworld_IN l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="INDIA", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.dexportinworld_IN  l.surpxdexpinworld_IN l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="INDIA", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.exportinworld_IN l.surpxexpinworld_IN l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="INDIA", fe cluster(ccode)

xtreg  ssPTA l.ssPTA  l.surplab_new l.dexportinworld_CN  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe cluster(ccode)
xtreg  ssPTA l.ssPTA  l.surplab_new l.dexportinworld_CN l.WTO l.high_income_gsp l.surpxdexpinworld_CN l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe cluster(ccode)
xtreg  ssPTA l.ssPTA  l.surplab_new l.exportinworld_CN l.surpxexpinworld_CN l.WTO  l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.dexportinworld_CN l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.dexportinworld_CN l.surpxdexpinworld_CN l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.exportinworld_CN l.high_income_gsp l.surpxexpinworld_CN l.WTO l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe cluster(ccode)

xtreg  ssPTA l.ssPTA  l.surplab_new l.dexportinworld_ZA l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="SOUTH AFRICA", fe cluster(ccode)
xtreg  ssPTA l.ssPTA  l.surplab_new l.dexportinworld_ZA l.surpxdexpinworld_ZA l.WTO l.high_income_gsp  l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="SOUTH AFRICA", fe cluster(ccode)
xtreg  ssPTA l.ssPTA  l.surplab_new l.exportinworld_ZA l.surpxexpinworld_ZA l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="SOUTH AFRICA", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.dexportinworld_ZA l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="SOUTH AFRICA", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.dexportinworld_ZA  l.surpxdexpinworld_ZA l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="SOUTH AFRICA", fe cluster(ccode)
xtreg  regPTA_ss_all l.regPTA_ss_all  l.surplab_new l.exportinworld_ZA l.surpxexpinworld_ZA l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="SOUTH AFRICA", fe cluster(ccode)


*Figure 2
twoway (line nonheg_ssPTA_ctyavg year, sort lcolor(gs4) lpattern(solid)) (line heg_ssPTA_ctyavg year, sort lcolor(gs2) lpattern(longdash_dot_dot))  if year>=1960&year<=2010&developing==1, ytitle(Avg. # PTA Memberships Per Country) xtitle(Year) legend(order(1 "Non-BRIC SSPTAs" 2 "SSPTAs with BRICS"))


*Table 2
xtreg  ssPTA_change   l.surp_new_yeardemean l.dexportinworld_CN  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter    if developing==1&country~="CHINA", fe 

xtreg  ssPTA_change   l.c.surp_new_yeardemean##l.c.dexportinworld_CN  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter   if developing==1&country~="CHINA", fe 

xtreg  regPTA_ss_all_change   l.surp_new_yeardemean l.dexportinworld_CN l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe 

xtreg  regPTA_ss_all_change   l.c.surp_new_yeardemean##l.c.dexportinworld_CN l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe 


*used to make Figure 3 
xtreg  ssPTA_change   l.c.surp_new_yeardemean##l.c.dexportinworld_CN  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter   if developing==1&country~="CHINA", fe 
margins, dydx(l.dexportinworld_CN) at(l.surp_new_yeardemean=(0(.1)1)) vsquish 

*use dataset "Data_Figure_3"
graph twoway  (line Coeff SurplusLabor, lcolor(black)) (line CI_low SurplusLabor, lcolor(black) lpattern(dash) ) (line CI_high SurplusLabor, lcolor (black) lpattern(dash)) (line SurplusLaborfrequency SurplusLabor, yaxis(2)) if SurplusLabor>=0&SurplusLabor<=.9, legend(off) ytitle("Effect of Change in China's Export Share") xtitle("Surplus Labor")
*when plot appears, click on graph editor, then double click on the line of the histogram and change it manually to spike with size extra extra large (largest size), and change color to grayscale 12*


*Figure 4a
twoway (line ratio5_byyrmed_surptophalf year if developing==1&year>=1990, sort lpattern(solid) lcolor(gs4)) (line ratio5_byyrmed_surpbottomhalf year if developing==1&year>=1990, sort lpattern(longdash_shortdash) lcolor(gs2)), ytitle(China Export Threat Ratio) xtitle(Year) legend(order(1 "High Surplus Labor" 2 "Low Surplus Labor"))

*Figure 4b
twoway (line chi_imp_surphi_avgbyyr year if year>=1990, sort lpattern(solid) lcolor(gs4)) (line chi_imp_surplow_avgbyyr year if year>=1990, sort lpattern(longdash_shortdash) lcolor(gs2)), ytitle(Imports from China (% GDP)) xtitle(Year) legend(order(1 "High Surplus Labor" 2 "Low Surplus Labor"))



*Table 3
xtreg  ssPTA_change l.ratio5_percchange_2yr l.surplab_new l.WTO l.high_income_gsp l.polity2 l.loggdppc  l.gdpGrowth  l.open_sachstotal l.ssPTA_devEx  i.year  if developing==1&country~="CHINA",  fe cluster(ccode)

xtreg  ssPTA_change l.c.ratio5_percchange_2yr##l.c.surplab_new l.WTO l.high_income_gsp l.polity2 l.loggdppc  l.gdpGrowth  l.open_sachstotal l.ssPTA_devEx  i.year  if developing==1&country~="CHINA",  fe cluster(ccode)

xtreg  regPTA_ss_all_change l.ratio5_percchange_2yr l.surplab_new l.WTO l.high_income_gsp l.polity2 l.loggdppc  l.gdpGrowth  l.open_sachstotal l.ssPTA_devEx  i.year  if developing==1&country~="CHINA",  fe cluster(ccode)

xtreg  regPTA_ss_all_change l.c.ratio5_percchange_2yr##l.c.surplab_new l.WTO l.high_income_gsp l.polity2 l.loggdppc  l.gdpGrowth  l.open_sachstotal l.ssPTA_devEx  i.year  if developing==1&country~="CHINA",  fe cluster(ccode)

*used to make Figure 5
xtreg  ssPTA_change l.c.ratio5_percchange_2yr##l.c.surplab_new l.WTO l.high_income_gsp l.polity2 l.loggdppc  l.gdpGrowth  l.open_sachstotal l.ssPTA_devEx  i.year  if developing==1&country~="CHINA",  fe cluster(ccode)
margins, dydx(l.ratio5_percchange_2yr) at(l.surplab_new=(0(.1)1)) vsquish level(90)
*use dataset "Data_Figure_5"
graph twoway  (line Coeff SurplusLabor, lcolor(black)) (line CI_low SurplusLabor, lcolor(black) lpattern(dash) ) (line CI_high SurplusLabor, lcolor (black) lpattern(dash)) (line SurplusLaborfrequency SurplusLabor, yaxis(2)) if SurplusLabor>=0&SurplusLabor<=.9, legend(off) ytitle("Effect of Change in Export Threat Ratio") xtitle("Surplus Labor")
*when plot appears, click on graph editor, then double click on the line of the histogram and change it manually to spike with size extra extra large (largest size), and change color to grayscale 12*


*Table 4

xtreg  ssPTA_change   l.surp_new_yeardemean l.d.chi_imp_pctgdp  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter    if developing==1&country~="CHINA", fe 

xtreg  ssPTA_change   l.c.surp_new_yeardemean##l.c.d.chi_imp_pctgdp  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter   if developing==1&country~="CHINA", fe 

xtreg  regPTA_ss_all_change   l.surp_new_yeardemean l.d.chi_imp_pctgdp l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe 

xtreg  regPTA_ss_all_change   l.c.surp_new_yeardemean##l.c.d.chi_imp_pctgdp l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe 


*Table 5
 diff ssPTA_change if developing==1&country~="CHINA"  &surplab_new>=.53&surplab_new~=., t(devLandSeaContig_rev) p(ChiWTO) cov(   polity2_lag1 loggdppc_lag1 ssPTA_devEx_lag1 open_sachstotal_lag1 counter ) cluster (ccode) robust
 
 diff regPTA_ss_all_change if developing==1&country~="CHINA"  &surplab_new>=.53&surplab_new~=., t(devLandSeaContig_rev) p(ChiWTO) cov(   polity2_lag1 loggdppc_lag1 ssPTA_devEx_lag1 open_sachstotal_lag1 counter ) cluster (ccode) robust

  
*Figure 6 (Trade Costs)
twoway (lowess Total_tradecost_devlpd_avg year if developing==1&surp_new_yeardemeanhi==1&year>=1995&year<=2015, lcolor(gs4)) (lowess Total_tradecost_devlpd_avg year if developing==1&surp_new_yeardemeanhi==0&year>=1995&year<=2015, lpattern(dash) lcolor(gs4)) (lowess Total_tradecost_devlpd_avg_CN year if year>=1995&year<=2015, lpattern(shortdash) lcolor(gs4)) (lowess Total_tradecost_devlpd_avg_BRIS year if year>=1995&year<=2015, lpattern(longdash_dot_dot) lcolor(gs4)), xtitle(Year) ytitle("Trade Costs with Developed Countries") legend(order(1 "High Surplus Developing" 2 "Low Surplus Developing" 3 "China" 4 "Other BRICS"))

**Appendix


*Appendix 3
xtnbreg  ssPTA_change   l.surp_new_yeardemean l.dexportinworld_CN  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter    if developing==1&country~="CHINA",  fe

xtnbreg  ssPTA_change   l.c.surp_new_yeardemean##l.c.dexportinworld_CN  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter   if developing==1&country~="CHINA", fe 

*Appendix 4
xtreg  ssPTA_change   l.surp_new_yeardemean l.exportinworld_CN  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter    if developing==1&country~="CHINA", fe 

xtreg  ssPTA_change   l.c.surp_new_yeardemean##l.c.exportinworld_CN  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter   if developing==1&country~="CHINA", fe 

xtreg  ssPTA_change l.ratio5_2yravg l.surplab_new l.WTO l.high_income_gsp l.polity2 l.loggdppc  l.gdpGrowth  l.open_sachstotal l.ssPTA_devEx  i.year  if developing==1&country~="CHINA",  fe cluster(ccode)

xtreg  ssPTA_change l.c.ratio5_2yravg##l.c.surplab_new l.WTO l.high_income_gsp l.polity2 l.loggdppc  l.gdpGrowth  l.open_sachstotal l.ssPTA_devEx  i.year  if developing==1&country~="CHINA",  fe cluster(ccode)

xtreg  ssPTA_change   l.surp_new_yeardemean l.chi_imp_pctgdp  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter    if developing==1&country~="CHINA", fe 

xtreg  ssPTA_change   l.c.surp_new_yeardemean##l.c.chi_imp_pctgdp  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter   if developing==1&country~="CHINA", fe 


*Appendix 5
xtreg  ssPTA l.ssPTA  l.logpop l.dexportinworld_CN  l.WTO l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe cluster(ccode)

xtreg  ssPTA l.ssPTA  l.logpop l.dexportinworld_CN l.WTO l.logpopxdexpinworld_CN l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe cluster(ccode)

xtreg  ssPTA l.ssPTA  l.arablelandpercap l.dexportinworld_CN  l.WTO l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe cluster(ccode)

xtreg  ssPTA l.ssPTA  l.arablelandpercap l.dexportinworld_CN l.WTO l.arablepercapxdexpinworld_CN l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe cluster(ccode)

*Appendix 6
xtreg  nsPTA_change    l.dexportinworld_CN  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter    if developing==1&country~="CHINA", fe 

xtreg  nsPTA_change   l.c.loggdppc##l.c.dexportinworld_CN  l.WTO l.high_income_gsp l.polity2  l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter   if developing==1&country~="CHINA", fe 

xtreg  regPTA_ss_all_change    l.dexportinworld_CN l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe 

xtreg  regPTA_ss_all_change   l.c.loggdppc##l.c.dexportinworld_CN l.WTO l.high_income_gsp l.polity2  l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter  if developing==1&country~="CHINA", fe 


*Appendix 8
xtreg  ssPTA_change    l.dexportinworld_CN  l.WTO l.high_income_gsp l.polity2 l.loggdppc l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter    if developing==1&country~="CHINA", fe 

xtreg  ssPTA_change   l.c.loggdppc##l.c.dexportinworld_CN  l.WTO l.high_income_gsp l.polity2  l.gdpGrowth l.ssPTA_devEx l.open_sachstotal counter   if developing==1&country~="CHINA", fe 

xtreg  ssPTA_change l.ratio5_percchange_2yr  l.WTO l.high_income_gsp l.polity2 l.loggdppc  l.gdpGrowth  l.open_sachstotal l.ssPTA_devEx  i.year  if developing==1&country~="CHINA",  fe cluster(ccode)

xtreg  ssPTA_change l.c.ratio5_percchange_2yr##l.c.loggdppc l.WTO l.high_income_gsp l.polity2   l.gdpGrowth  l.open_sachstotal l.ssPTA_devEx  i.year  if developing==1&country~="CHINA",  fe cluster(ccode)
